<div class="dsp-voucher-exchange">
    {if $result===TRUE}
    <form method="post" action="{:url('Pointvoucher/voucherexchange_save')}" id="exform">
        <input type="hidden" name="vid" value="{$template_info.vouchertemplate_id}"/>
        <div class="pic">
            <span>
                <img src="{$template_info.vouchertemplate_customimg}"/>
            </span>
        </div>
        <dl>
            <dt>{$Think.lang.home_bein_use}<span class="ml5 mr5">{$template_info.vouchertemplate_points}</span>{$Think.lang.points_unit}&nbsp;{$Think.lang.home_exchange_one|raw}<br/>
            {$template_info.store_name}{$template_info.vouchertemplate_price}{$Think.lang.ds_yuan}{$Think.lang.store_voucher}（<em>{$Think.lang.home_voucher_desc_1}{$template_info.vouchertemplate_limit}{$Think.lang.home_voucher_desc_2}{$template_info.vouchertemplate_price}</em>）</dt>
            <dd>{$Think.lang.store_voucher_valid_until}{:date('Y-m-d',$template_info.vouchertemplate_enddate)}</dd>
            <dd>
                {if $template_info.vouchertemplate_eachlimit >0}
                {$Think.lang.each_id_collection}{$template_info.vouchertemplate_eachlimit}{$Think.lang.ds_zhang}
                {else/}
                {$Think.lang.each_id_collection_unlimited}
                {/if}
            </dd>
        </dl>
        <div class="button">
            <input type="submit" class="submit" value="{$Think.lang.exchange}"/>
            <a href="javascript:DialogManager.close('vexchange');" class="dsp-btn">{$Think.lang.ds_cancel}</a>
        </div>
    </form>
    {else/}
    <div class="errormsg" style="height:50px; text-align:center;">{$message}</div>
    <div style="text-align:center;"><a href="javascript:DialogManager.close('vexchange');" class="dsp-btn">{$Think.lang.ds_cancel}</a></div>
    {/if}
</div>
<script>
$(document).ready(function(){
    $('#exform').validate({
    	submitHandler:function(form){
            ds_ajaxpost('exform');
    	}
    });
});
</script>